package com.example.usercenter.sys.dao;

import com.example.usercenter.common.base.BaseDao;
import com.example.usercenter.sys.entity.Org;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface OrgDao extends BaseDao<Org, Long> {

    public int deleteUserOrg(long id);

    public int updateChildrenPathById(@Param("id") long id, @Param("oldPath") String oldPath, @Param("newPath") String newPath);

    public int updateChildrenPathByPath(@Param("id") long id, @Param("oldPath") String oldPath, @Param("newPath") String newPath);

    public int updateChildrenToRoot(Org entity);
    /**
     * 根据用户ID和权限代码查询授权所在组织
     * */
    public List<Org> queryByUserIdAndCode(@Param("userId")long userId, @Param("code")String code);
}